package com.vcc.service.client.vo.role;

import com.vcc.data.entity.Role;
import com.vcc.service.client.vo.baseVo.BaseVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@Getter
@Setter
public class RoleVo extends BaseVo implements Serializable {

    private String code;

    private String name;

    private Boolean hasClientUpdate;

    private Boolean hasAllData;

    private List<ClientPermissionVo> permissionVos;

    public RoleVo() {
    }

    public RoleVo(Role role, List<ClientPermissionVo> permissionVos) {
        super.setId(role.getId());
        super.setCreateDate(role.getCreateDate());
        super.setUpdateDate(role.getUpdateDate());
        this.code = role.getCode();
        this.name = role.getName();
        this.hasClientUpdate = role.getHasClientUpdate();
        this.hasAllData = role.getHasAllData();
        this.permissionVos = permissionVos;

    }

}
